import TabsView from '@/layouts/tabs/TabsView'
import BlankView from '@/layouts/BlankView'
// import PageView from '@/layouts/PageView'

// 路由配置
const options = {
  routes: [
    {
      path: '/login',
      name: '登录页',
      component: () => import('@/pages/login')
    },
    {
      path: '*',
      name: '404',
      component: () => import('@/pages/exception/404'),
    },
    {
      path: '/403',
      name: '403',
      component: () => import('@/pages/exception/403'),
    },
    {
      path: '/',
      name: '首页',
      component: TabsView,
      redirect: '/dashboard',
      children: [
        {
          path: 'dashboard',
          name: '仪表盘',
          meta: {
            icon: 'dashboard'
          },
          component: () => import('@/pages/dashboard/workplace'),

        },
        {
          path: 'demand',
          name: '需求管理',
          meta: {
            icon: 'form'
          },
          // eslint-disable-next-line no-unused-vars
          component: { render: h => h("router-view") },
          children: [
            {
              path: 'processing',
              name: "处理中",
              component: () => import('@/pages/demand/processing'),
            },
            {
              path: 'processed',
              name: "已完成",
              component: () => import('@/pages/demand/processed'),
            },
            {
              path: 'processedStop',
              name: "已中止",
              component: () => import('@/pages/demand/processedStop'),
            },
            {
              path: 'surveyAdd',
              name: "添加或编辑需求调研",
              component: () => import('@/pages/demand/surveyAdd'),
              meta: {
                invisible: true
              },
            },
            {
              path: 'surveyDetail',
              name: "需求调研详情",
              component: () => import('@/pages/demand/surveyDetail'),
              meta: {
                invisible: true
              },
            },
            {
              path: 'detail',
              name: "需求详情",
              component: () => import('@/pages/demand/detail'),
              meta: {
                invisible: true
              },
            },
            {
              path: 'add',
              name: "新增或变更需求",
              component: () => import('@/pages/demand/add'),
              meta: {
                invisible: true
              },
            }
          ]
        },
        {
          path: 'task',
          name: '任务管理',
          meta: {
            icon: 'profile'
          },
          // eslint-disable-next-line no-unused-vars
          component: { render: h => h("router-view") },
          children: [
            {
              path: 'processing',
              name: "进行中",
              component: () => import('@/pages/task/processing'),
            },
            {
              path: 'processed',
              name: "已完成",
              component: () => import('@/pages/task/processed'),
            },
            {
              path: 'processedStop',
              name: "已中止",
              component: () => import('@/pages/task/processedStop'),
            },
            {
              path: 'detail',
              name: "任务详情",
              component: () => import('@/pages/task/detail'),
              meta: {
                invisible: true
              },
            },
            {
              path: 'add',
              name: "新增或变更任务",
              component: () => import('@/pages/task/add'),
              meta: {
                invisible: true
              },
            }
          ]
        },
        {
          path: 'project',
          name: '项目管理',
          meta: {
            icon: 'project'
          },
          // eslint-disable-next-line no-unused-vars
          component: { render: h => h("router-view") },
          children: [
            {
              path: 'index',
              name: "项目列表",
              component: () => import('@/pages/project/index'),
            },
            {
              path: 'detail',
              name: "项目详情",
              component: () => import('@/pages/project/detail'),
              meta: {
                invisible: true
              },
            },
            {
              path: 'add',
              name: "新增或变更项目",
              component: () => import('@/pages/project/add'),
              meta: {
                invisible: true
              },
            }
          ]
        },
        {
          path: 'produce',
          name: '产品管理',
          meta: {
            icon: 'bulb'
          },
          // eslint-disable-next-line no-unused-vars
          component: { render: h => h("router-view") },
          children: [
            {
              path: 'index',
              name: "产品列表",
              component: () => import('@/pages/produce/index'),
            },
            {
              path: 'detail',
              name: "产品详情",
              component: () => import('@/pages/produce/detail'),
              meta: {
                invisible: true
              },
            },
            {
              path: 'add',
              name: "新增/编辑产品",
              component: () => import('@/pages/produce/add'),
              meta: {
                invisible: true
              },
            }
          ]
        },
        {
          path: 'setting',
          name: '账号管理',
          meta: {
            icon: 'user'
          },
          component: BlankView,
          children: [
            {
              path: 'department',
              name: "部门列表",
              component: () => import('@/pages/department/index'),
            },
            {
              path: 'menu',
              name: "菜单列表",
              component: () => import('@/pages/menu/index'),
            },
            {
              path: 'role',
              name: '角色列表',
              component: () => import('@/pages/user/role'),
            },
            {
              path: 'roleAdd',
              name: '角色添加或者修改',
              meta: {
                invisible: true
              },
              component: () => import('@/pages/user/roleAdd')
            },
            {
              path: 'user',
              name: '账号列表',
              component: () => import('@/pages/user/user'),

            },
            {
              path: 'userAdd',
              name: '账号添加或者修改',
              meta: {
                invisible: true
              },
              component: () => import('@/pages/user/UserAdd.vue')
            },
            {
              path: 'permissions',
              name: '权限列表',
              component: () => import('@/pages/user/permissions')
            },
            {
              path: 'permissionsAdd',
              name: '权限添加或者修改',
              meta: {
                invisible: true
              },
              component: () => import('@/pages/user/permissionsAdd')
            },
          ]
        },
        {
          path: 'user',
          meta: {
            invisible: true
          },
          name: '账户设置',
          component: () => import('@/pages/user/UserSetting')
        },
        {
          path: 'exception',
          name: '异常页',
          meta: {
            icon: 'warning',
            invisible: true
          },
          component: BlankView,
          children: [
            {
              path: '404',
              name: 'Exp404',
              component: () => import('@/pages/exception/404')
            },
            {
              path: '403',
              name: 'Exp403',
              component: () => import('@/pages/exception/403')
            },
            {
              path: '500',
              name: 'Exp500',
              component: () => import('@/pages/exception/500')
            }
          ]
        },
      ]
    },
  ]
}

export default options
